package com.slipper.ai.flow;

import java.util.HashMap;
import java.util.Map;

public class NodeDealerFactory {
    private static final Map<String, INodeDealer> nodeDealerMap = new HashMap<>();
    
    public static void register(String type, INodeDealer nodeDealer) {
        nodeDealerMap.put(type, nodeDealer);
    }

    public static INodeDealer getNodeDealer(String type) {
        INodeDealer nodeDealer = nodeDealerMap.get(type);
        if (nodeDealer == null) {
            throw new RuntimeException("节点类型为[" + type + "]的节点处理器不存在！");
        }
        return nodeDealer;
    }
}
